<template>
    <div>

            <el-form :inline="true" :model="params" class="demo-form-inline">
                <el-form-item>
                    <el-input v-model="params.value" placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-select v-model="params.xlk" placeholder="请选择">
                        <el-option label="---" value=""></el-option>
                        <el-option label="案号查询" value="caseNo"></el-option>
                        <el-option label="归档人查询" value="borrowFilePeople"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="search">查询</el-button>
                </el-form-item>
                <el-button type="primary" @click="pldel">批量删除</el-button>
            </el-form>


            <el-table
                    :data="pageResult.records"
                    border
                    style="width: 100%"
                    tooltip-effect="dark"
                    ref="multipleTable"
                    @selection-change="handleSelectionChange">
                <el-table-column
                        type="selection"
                        width="55">
                </el-table-column>
                <el-table-column
                        fixed
                        prop="id"
                        label="编号"
                        width="100">
                </el-table-column>
                <el-table-column
                        prop="caseNo"
                        label="案号">
                </el-table-column>
                <el-table-column
                        prop="recordNum"
                        label="档案号">
                </el-table-column>
                <el-table-column
                        prop="recordName"
                        label="档案名称">
                </el-table-column>
                <el-table-column
                        prop="borrowFilePeople"
                        label="借档人">
                </el-table-column>
                <el-table-column
                        prop="borrowDate"
                        label="借出时间">
                </el-table-column>
                <el-table-column
                        prop="giveBackDate"
                        label="归还时间">
                </el-table-column>
                <el-table-column
                        prop="remark"
                        label="备注">
                </el-table-column>
            </el-table>

            <el-footer class="case-exam-footer">
                <el-pagination
                        background
                        layout="prev, pager, next"
                        :total="pageResult.total"
                        :page-size="pageResult.size"
                        class="pagination"
                        @current-change="handleIndexChange"
                >
                </el-pagination>
            </el-footer>
    </div>
</template>

<script>


    import RecordNoArchiveslibraryService from '../../../model/mfy/onFile/RecordNoArchiveslibraryService.js'
    var recordNoArchiveslibraryService=RecordNoArchiveslibraryService.getInstance();

    export default {
        name: "dananjieyue",
        data(){
            return{
                pageResult:{},
                params:{},
                recordarchiveslibrary:[],
                multipleSelection:[],
            }
        },
        methods:{
            list(){
                recordNoArchiveslibraryService.list(this.params).then(response=>{
                    this.pageResult = response.data.data
                })
            },
            pldel(){
                if(this.multipleSelection==null || this.multipleSelection==''){
                    this.$message.error("请选择要删除的案件!")
                    return;
                }
                var a = [];
                this.multipleSelection.forEach(i=>{
                    a.push(i.id)
                })
                recordNoArchiveslibraryService.del(a).then(()=>{
                    this.list();
                })

            },
            handleSelectionChange(val) {
                this.multipleSelection = val;
            },
            handleIndexChange(index){
                this.params.page = index
                this.list()
            },
            search(){
                this.params.page=1
                this.list()
            },
        },
        created() {
            this.list()
        },
        components:{
        }
    }
</script>

<style scoped>

</style>